package com.autumn.zero.authorization.entitys.users;

import javax.persistence.Column;
import javax.persistence.Table;

import com.autumn.constants.SettingConstants;
import com.autumn.domain.entities.AbstractDefaultEntity;
import com.autumn.mybatis.mapper.annotation.ColumnOrder;
import com.autumn.mybatis.mapper.annotation.Index;

/**
 * 用户角色
 * 
 * @author 杨昌国 2018-11-25 00:37:55
 */
@Table(name = SettingConstants.SYS_TABLE_PREFIX + "_user_role")
public class UserRole extends AbstractDefaultEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = -809690005089160799L;

	/**
	 * 字段 userId
	 */
	public static final String FILED_USER_ID = "userId";
	
	/**
	 * 字段 roleId
	 */
	public static final String FILED_ROLE_ID = "roleId";
	
	/**
	 * 用户id
	 */	
	@Column(name = "user_id", nullable = false)
	@Index
	@ColumnOrder(1)
	private Long userId;

	/**
	 * 角色Id
	 */	
	@Column(name = "role_id", nullable = false)
	@Index
	@ColumnOrder(2)
	private Long roleId;

	/**
	 * 获取用户Id
	 * 
	 * @return
	 */
	public Long getUserId() {
		return userId;
	}

	/**
	 * 设置用户Id
	 * 
	 * @param userId 用户Id
	 */
	public void setUserId(Long userId) {
		this.userId = userId;
	}

	/**
	 * 获取角色Id
	 * 
	 * @return
	 */
	public Long getRoleId() {
		return roleId;
	}

	/**
	 * 设置角色Id
	 * 
	 * @param roleId 角色Id
	 */
	public void setRoleId(Long roleId) {
		this.roleId = roleId;
	}

}
